package com.naiking.manager
{
	import flash.display.Stage;
	import flash.events.KeyboardEvent;

	public class KeyManager
	{
		private var _shiftKey:Boolean;
		private var _ctrKey:Boolean;
		private var _altKey:Boolean;
		public function init($stage:Stage):void
		{
			$stage.addEventListener(KeyboardEvent.KEY_DOWN,onKey);
			$stage.addEventListener(KeyboardEvent.KEY_UP,onKey);
		}
		private function onKey(e:KeyboardEvent):void
		{
			_shiftKey=e.shiftKey;
			_ctrKey=e.ctrlKey;
			_altKey=e.altKey;
		}
		public function get shiftKey():Boolean
		{
			return _shiftKey;
		}
		public function get altKey():Boolean
		{
			return _altKey;
		}	
		public function get ctrKey():Boolean
		{
			return _ctrKey;
		}	
		public function KeyManager(_sig:Sig)
		{
		}
		private static var _ins:KeyManager;
		public static function getIns():KeyManager
		{
			if(!_ins)
				_ins=new KeyManager(new Sig());
			return _ins;
		}
	}
}
final class Sig{}